
<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <div>
      <el-table :data="wxList" style="width: 100%">
            <el-table-column  prop="num" label= "序号" width= "180"> </el-table-column>
            <el-table-column  prop="name" label= "股票名称" width= "180"> </el-table-column>
            <el-table-column  prop="ticker" label= "股票代码" width= "180"> </el-table-column>
            <el-table-column  prop="isActiveStr" label= "状态" width= "180"> </el-table-column>
            <el-table-column  prop="profitAndLoss" label= "profit/Loss" width= "180"> </el-table-column>
            <el-table-column  prop="continueDay" label= "持续天数" width= "180"> </el-table-column>
            <el-table-column  prop="rate" label= "率" width= "180"> </el-table-column>
            <el-table-column  prop="updateTime" label= "更新时间" width= "180"> </el-table-column>
          </el-table>
      <ul>
        <!-- <li v-for="wsdata in wxList" :key="wsdata.id">
          <div></div>
          
        </li> -->

      </ul>

    </div>

  </div>
</template>

<script>
import axios from 'axios'
export default {

  // name: 'analysisExec',
  props: {
    msg: String
  },
  data() {
    return {
      num: 1,
      wxList: [
        
      ],

    };
  },

  methods: {
    simList() {
      axios({
        method: 'get',
        url: '/api/stock/base/list',
      })
        .then(res => {
          this.wxList = res.data.data.map(v=>{
            v.name = v.name
            v.ticker = v.ticker
            v.isActiveStr = v.isActive == 1 ? "正常" : "异常"
            v.profitAndLoss = v.profitAndLoss
            v.continueDay = v.continueDay
            v.rate = v.rate
            v.updateTime = v.updateTime
            v.num = this.num++;
            return v 
          });
          // this.wxList.reverse();
        })
    },
  },

  created() {

    this.simList()
  }

}

</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
  margin: 40px 0 0;
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  display: inline-block;
  margin: 0 10px;
}

a {
  color: #42b983;
}
</style>
